home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / autose1g / frmresea.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-06-24  |  52.6 KB  |  1,537 lines

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form frmResearch 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Technology Research Centre"
  6.    ClientHeight    =   5460
  7.    ClientLeft      =   495
  8.    ClientTop       =   1425
  9.    ClientWidth     =   8850
  10.    ControlBox      =   0   'False
  11.    Icon            =   "FRMRESEA.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    PaletteMode     =   1  'UseZOrder
  16.    ScaleHeight     =   5460
  17.    ScaleWidth      =   8850
  18.    Begin VB.PictureBox Picture1 
  19.       Height          =   3660
  20.       Left            =   4695
  21.       Picture         =   "FRMRESEA.frx":0ECA
  22.       ScaleHeight     =   3600
  23.       ScaleWidth      =   3975
  24.       TabIndex        =   15
  25.       Top             =   135
  26.       Width           =   4035
  27.    End
  28.    Begin VB.Frame fraSelect 
  29.       Caption         =   "Select Technology To Research:"
  30.       BeginProperty Font 
  31.          Name            =   "MS Sans Serif"
  32.          Size            =   9.75
  33.          Charset         =   0
  34.          Weight          =   700
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       Height          =   3555
  40.       Left            =   4785
  41.       TabIndex        =   2
  42.       Top             =   255
  43.       Width           =   3825
  44.       Begin VB.OptionButton optCloaking 
  45.          Caption         =   "Cloaking Device"
  46.          Enabled         =   0   'False
  47.          Height          =   285
  48.          Left            =   1890
  49.          TabIndex        =   21
  50.          Top             =   2820
  51.          Width           =   1680
  52.       End
  53.       Begin VB.OptionButton optJammer 
  54.          Caption         =   "Anti-Scanning Jammer"
  55.          Enabled         =   0   'False
  56.          Height          =   195
  57.          Left            =   1305
  58.          TabIndex        =   20
  59.          Top             =   1290
  60.          Width           =   2115
  61.       End
  62.       Begin VB.OptionButton optDeepScanner 
  63.          Caption         =   "Deep-Space Scanner"
  64.          Enabled         =   0   'False
  65.          Height          =   210
  66.          Left            =   1305
  67.          TabIndex        =   19
  68.          Top             =   1005
  69.          Width           =   1800
  70.       End
  71.       Begin VB.OptionButton optScanner 
  72.          Caption         =   "Space Scanner"
  73.          Height          =   315
  74.          Left            =   765
  75.          TabIndex        =   18
  76.          Top             =   660
  77.          Width           =   2115
  78.       End
  79.       Begin VB.OptionButton optFastShips 
  80.          Caption         =   "Ultra-Warp Ship Engines"
  81.          Enabled         =   0   'False
  82.          Height          =   285
  83.          Left            =   1335
  84.          TabIndex        =   17
  85.          Top             =   2505
  86.          Width           =   2040
  87.       End
  88.       Begin VB.OptionButton optBigShips 
  89.          Caption         =   "Expand Ship Capacity"
  90.          Height          =   285
  91.          Left            =   750
  92.          TabIndex        =   16
  93.          Top             =   2220
  94.          Width           =   2040
  95.       End
  96.       Begin VB.OptionButton optResources 
  97.          Caption         =   "Improved Resource Production"
  98.          Height          =   285
  99.          Left            =   750
  100.          TabIndex        =   6
  101.          Top             =   3150
  102.          Width           =   2520
  103.       End
  104.       Begin VB.OptionButton optShips 
  105.          Caption         =   "Ship Weaponry"
  106.          Height          =   285
  107.          Left            =   750
  108.          TabIndex        =   5
  109.          Top             =   1890
  110.          Width           =   2040
  111.       End
  112.       Begin VB.OptionButton optAssault 
  113.          Caption         =   "Mechanized Assault Troops"
  114.          Height          =   270
  115.          Left            =   765
  116.          TabIndex        =   4
  117.          Top             =   1560
  118.          Width           =   2250
  119.       End
  120.       Begin VB.OptionButton optPlanetary 
  121.          Caption         =   "Planetary Shields/Missiles"
  122.          Height          =   315
  123.          Left            =   750
  124.          TabIndex        =   3
  125.          Top             =   360
  126.          Width           =   2115
  127.       End
  128.    End
  129.    Begin VB.CommandButton cmdCancel 
  130.       Caption         =   "&Cancel"
  131.       Height          =   330
  132.       Left            =   6795
  133.       TabIndex        =   1
  134.       Top             =   4455
  135.       Width           =   1200
  136.    End
  137.    Begin VB.CommandButton cmdOK 
  138.       Caption         =   "&OK"
  139.       Enabled         =   0   'False
  140.       Height          =   330
  141.       Left            =   5505
  142.       TabIndex        =   0
  143.       Top             =   4455
  144.       Width           =   1200
  145.    End
  146.    Begin VB.Frame fraAmount 
  147.       Caption         =   "Research Teams Allocated:"
  148.       Enabled         =   0   'False
  149.       BeginProperty Font 
  150.          Name            =   "MS Sans Serif"
  151.          Size            =   9.75
  152.          Charset         =   0
  153.          Weight          =   700
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       Height          =   2355
  159.       Left            =   75
  160.       TabIndex        =   7
  161.       Top             =   2985
  162.       Width           =   4515
  163.       Begin VB.TextBox txtTotal 
  164.          BackColor       =   &H00000000&
  165.          BeginProperty Font 
  166.             Name            =   "MS Sans Serif"
  167.             Size            =   9.75
  168.             Charset         =   0
  169.             Weight          =   700
  170.             Underline       =   0   'False
  171.             Italic          =   0   'False
  172.             Strikethrough   =   0   'False
  173.          EndProperty
  174.          ForeColor       =   &H0000FF00&
  175.          Height          =   360
  176.          Left            =   2040
  177.          Locked          =   -1  'True
  178.          TabIndex        =   12
  179.          Top             =   1650
  180.          Width           =   585
  181.       End
  182.       Begin VB.TextBox txtUnitCost 
  183.          BackColor       =   &H00000000&
  184.          BeginProperty Font 
  185.             Name            =   "MS Sans Serif"
  186.             Size            =   9.75
  187.             Charset         =   0
  188.             Weight          =   700
  189.             Underline       =   0   'False
  190.             Italic          =   0   'False
  191.             Strikethrough   =   0   'False
  192.          EndProperty
  193.          ForeColor       =   &H0000FF00&
  194.          Height          =   360
  195.          Left            =   2025
  196.          Locked          =   -1  'True
  197.          TabIndex        =   10
  198.          Top             =   300
  199.          Width           =   585
  200.       End
  201.       Begin VB.HScrollBar hsbAmount 
  202.          Height          =   255
  203.          LargeChange     =   2
  204.          Left            =   975
  205.          Max             =   0
  206.          TabIndex        =   8
  207.          Top             =   960
  208.          Width           =   2520
  209.       End
  210.       Begin VB.Label lblQuantity 
  211.          BeginProperty Font 
  212.             Name            =   "MS Sans Serif"
  213.             Size            =   9.75
  214.             Charset         =   0
  215.             Weight          =   700
  216.             Underline       =   0   'False
  217.             Italic          =   0   'False
  218.             Strikethrough   =   0   'False
  219.          EndProperty
  220.          Height          =   285
  221.          Left            =   3150
  222.          TabIndex        =   14
  223.          Top             =   1020
  224.          Width           =   315
  225.       End
  226.       Begin VB.Label lblName 
  227.          Height          =   195
  228.          Left            =   660
  229.          TabIndex        =   13
  230.          Top             =   735
  231.          Width           =   2430
  232.       End
  233.       Begin VB.Label lblTotal 
  234.          Caption         =   "TOTAL:"
  235.          BeginProperty Font 
  236.             Name            =   "MS Sans Serif"
  237.             Size            =   8.25
  238.             Charset         =   0
  239.             Weight          =   700
  240.             Underline       =   0   'False
  241.             Italic          =   0   'False
  242.             Strikethrough   =   0   'False
  243.          EndProperty
  244.          Height          =   255
  245.          Left            =   1320
  246.          TabIndex        =   11
  247.          Top             =   1725
  248.          Width           =   660
  249.       End
  250.       Begin VB.Label lblUnitCost 
  251.          Caption         =   "Cost Per Team:"
  252.          Height          =   240
  253.          Left            =   750
  254.          TabIndex        =   9
  255.          Top             =   375
  256.          Width           =   1185
  257.       End
  258.    End
  259.    Begin TabDlg.SSTab tabResearch 
  260.       Height          =   2745
  261.       Left            =   75
  262.       TabIndex        =   22
  263.       Top             =   120
  264.       Width           =   4515
  265.       _ExtentX        =   7964
  266.       _ExtentY        =   4842
  267.       _Version        =   393216
  268.       Style           =   1
  269.       Tabs            =   5
  270.       Tab             =   4
  271.       TabsPerRow      =   5
  272.       TabHeight       =   520
  273.       TabCaption(0)   =   "Planetary"
  274.       TabPicture(0)   =   "FRMRESEA.frx":124CC
  275.       Tab(0).ControlEnabled=   0   'False
  276.       Tab(0).Control(0)=   "optShield"
  277.       Tab(0).Control(1)=   "optBase2"
  278.       Tab(0).Control(2)=   "optBase1"
  279.       Tab(0).ControlCount=   3
  280.       TabCaption(1)   =   "Military"
  281.       TabPicture(1)   =   "FRMRESEA.frx":124E8
  282.       Tab(1).ControlEnabled=   0   'False
  283.       Tab(1).Control(0)=   "optLongBioRocket"
  284.       Tab(1).Control(1)=   "optChemical"
  285.       Tab(1).Control(2)=   "optMech"
  286.       Tab(1).Control(3)=   "optPlasma"
  287.       Tab(1).Control(4)=   "optLasers"
  288.       Tab(1).ControlCount=   5
  289.       TabCaption(2)   =   "Warp Ships"
  290.       TabPicture(2)   =   "FRMRESEA.frx":12504
  291.       Tab(2).ControlEnabled=   0   'False
  292.       Tab(2).Control(0)=   "optCloak"
  293.       Tab(2).Control(1)=   "optUltra"
  294.       Tab(2).Control(2)=   "optBigger"
  295.       Tab(2).Control(3)=   "optShields2"
  296.       Tab(2).Control(4)=   "optShields1"
  297.       Tab(2).ControlCount=   5
  298.       TabCaption(3)   =   "Resources"
  299.       TabPicture(3)   =   "FRMRESEA.frx":12520
  300.       Tab(3).ControlEnabled=   0   'False
  301.       Tab(3).Control(0)=   "optRegenerate"
  302.       Tab(3).Control(1)=   "optCleanup"
  303.       Tab(3).Control(2)=   "optImprove"
  304.       Tab(3).ControlCount=   3
  305.       TabCaption(4)   =   "Scanners"
  306.       TabPicture(4)   =   "FRMRESEA.frx":1253C
  307.       Tab(4).ControlEnabled=   -1  'True
  308.       Tab(4).Control(0)=   "optShortScan"
  309.       Tab(4).Control(0).Enabled=   0   'False
  310.       Tab(4).Control(1)=   "optLongScan"
  311.       Tab(4).Control(1).Enabled=   0   'False
  312.       Tab(4).Control(2)=   "optJam"
  313.       Tab(4).Control(2).Enabled=   0   'False
  314.       Tab(4).Control(3)=   "optWarpScan"
  315.       Tab(4).Control(3).Enabled=   0   'False
  316.       Tab(4).ControlCount=   4
  317.       Begin VB.OptionButton optLongBioRocket 
  318.          Caption         =   "Long-Range BioHazard Rocket"
  319.          Height          =   255
  320.          Left            =   -74460
  321.          TabIndex        =   42
  322.          Top             =   2025
  323.          Visible         =   0   'False
  324.          Width           =   2655
  325.       End
  326.       Begin VB.OptionButton optRegenerate 
  327.          Caption         =   "Regenerate Barren Environments"
  328.          Height          =   240
  329.          Left            =   -74460
  330.          TabIndex        =   41
  331.          Top             =   1315
  332.          Visible         =   0   'False
  333.          Width           =   2700
  334.       End
  335.       Begin VB.OptionButton optCleanup 
  336.          Caption         =   "BioHazard Detoxification"
  337.          Height          =   225
  338.          Left            =   -74460
  339.          TabIndex        =   40
  340.          Top             =   960
  341.          Visible         =   0   'False
  342.          Width           =   2310
  343.       End
  344.       Begin VB.OptionButton optImprove 
  345.          Caption         =   "Improved Resource Production"
  346.          Height          =   225
  347.          Left            =   -74460
  348.          TabIndex        =   39
  349.          Top             =   600
  350.          Width           =   3255
  351.       End
  352.       Begin VB.OptionButton optCloak 
  353.          Caption         =   "Cloaking Device"
  354.          Height          =   210
  355.          Left            =   -74460
  356.          TabIndex        =   38
  357.          Top             =   2025
  358.          Visible         =   0   'False
  359.          Width           =   2385
  360.       End
  361.       Begin VB.OptionButton optUltra 
  362.          Caption         =   "Ultra-Warp Ship Engines"
  363.          Height          =   240
  364.          Left            =   -74460
  365.          TabIndex        =   37
  366.          Top             =   1665
  367.          Visible         =   0   'False
  368.          Width           =   2505
  369.       End
  370.       Begin VB.OptionButton optBigger 
  371.          Caption         =   "Expand Ship Capacity"
  372.          Height          =   210
  373.          Left            =   -74460
  374.          TabIndex        =   36
  375.          Top             =   1315
  376.          Visible         =   0   'False
  377.          Width           =   2550
  378.       End
  379.       Begin VB.OptionButton optShields2 
  380.          Caption         =   "Shields - Level II"
  381.          Height          =   195
  382.          Left            =   -74460
  383.          TabIndex        =   35
  384.          Top             =   960
  385.          Visible         =   0   'False
  386.          Width           =   2790
  387.       End
  388.       Begin VB.OptionButton optShields1 
  389.          Caption         =   "Shields - Level I"
  390.          Height          =   270
  391.          Left            =   -74460
  392.          TabIndex        =   34
  393.          Top             =   600
  394.          Width           =   2685
  395.       End
  396.       Begin VB.OptionButton optChemical 
  397.          Caption         =   "BioHazard Rocket"
  398.          Height          =   255
  399.          Left            =   -74460
  400.          TabIndex        =   33
  401.          Top             =   1665
  402.          Visible         =   0   'False
  403.          Width           =   1920
  404.       End
  405.       Begin VB.OptionButton optMech 
  406.          Caption         =   "Mechanized Assault Units"
  407.          Height          =   225
  408.          Left            =   -74460
  409.          TabIndex        =   32
  410.          Top             =   1315
  411.          Visible         =   0   'False
  412.          Width           =   2520
  413.       End
  414.       Begin VB.OptionButton optPlasma 
  415.          Caption         =   "Plasma Rifle"
  416.          Height          =   240
  417.          Left            =   -74460
  418.          TabIndex        =   31
  419.          Top             =   960
  420.          Visible         =   0   'False
  421.          Width           =   1395
  422.       End
  423.       Begin VB.OptionButton optLasers 
  424.          Caption         =   "Laser Rifle"
  425.          Height          =   240
  426.          Left            =   -74460
  427.          TabIndex        =   30
  428.          Top             =   600
  429.          Width           =   1305
  430.       End
  431.       Begin VB.OptionButton optWarpScan 
  432.          Caption         =   "Warp Scanner"
  433.          Height          =   225
  434.          Left            =   540
  435.          TabIndex        =   29
  436.          Top             =   1665
  437.          Visible         =   0   'False
  438.          Width           =   2640
  439.       End
  440.       Begin VB.OptionButton optJam 
  441.          Caption         =   "Scanner Jamming Device"
  442.          Height          =   240
  443.          Left            =   540
  444.          TabIndex        =   28
  445.          Top             =   1315
  446.          Visible         =   0   'False
  447.          Width           =   2790
  448.       End
  449.       Begin VB.OptionButton optLongScan 
  450.          Caption         =   "Long-Range Scanner"
  451.          Height          =   240
  452.          Left            =   540
  453.          TabIndex        =   27
  454.          Top             =   960
  455.          Visible         =   0   'False
  456.          Width           =   2595
  457.       End
  458.       Begin VB.OptionButton optShortScan 
  459.          Caption         =   "Short-Range Scanner"
  460.          Height          =   195
  461.          Left            =   540
  462.          TabIndex        =   26
  463.          Top             =   600
  464.          Width           =   2655
  465.       End
  466.       Begin VB.OptionButton optShield 
  467.          Caption         =   "Planetary Shield"
  468.          Height          =   225
  469.          Left            =   -74460
  470.          TabIndex        =   25
  471.          Top             =   1315
  472.          Visible         =   0   'False
  473.          Width           =   2355
  474.       End
  475.       Begin VB.OptionButton optBase2 
  476.          Caption         =   "Missile Base - Level II"
  477.          Height          =   240
  478.          Left            =   -74460
  479.          TabIndex        =   24
  480.          Top             =   960
  481.          Visible         =   0   'False
  482.          Width           =   2430
  483.       End
  484.       Begin VB.OptionButton optBase1 
  485.          Caption         =   "Missile Base - Level I"
  486.          Height          =   210
  487.          Left            =   -74460
  488.          TabIndex        =   23
  489.          Top             =   600
  490.          Width           =   2370
  491.       End
  492.    End
  493. Attribute VB_Name = "frmResearch"
  494. Attribute VB_GlobalNameSpace = False
  495. Attribute VB_Creatable = False
  496. Attribute VB_PredeclaredId = True
  497. Attribute VB_Exposed = False
  498. Option Explicit
  499. Private Sub cmdCancel_Click()
  500. 'unload the form without doing anything
  501. Unload frmResearch
  502. End Sub
  503. Private Sub cmdOK_Click()
  504. If SoundOn Then
  505.     PlaySoundEffect "Button4"
  506. End If
  507. 'calculate the time to research
  508. 'these formulas have been changed a lot for play balance, and may not be the same as
  509. 'noted in each case statement
  510. PurchasePrice = Val(txtTotal.Text)
  511. Select Case lblName.Caption
  512. Case "Missile Base - Level I"
  513.     '*unit cost of 10--- finish in 2-5 turns
  514.     'set time to finish research
  515.     Player(Current).Missile1ResearchDone = TurnNumber + Int(Rnd * Int(30 / PurchasePrice)) + 2
  516.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  517.     'call update procedure
  518.     frmGameScreen.UpdatePlayerStats
  519. Case "Missile Base - Level II"
  520.     '**unit cost of 15--- finish in 2-5 turns
  521.     'set time to finish research
  522.     Player(Current).Missile2ResearchDone = TurnNumber + Int(Rnd * Int(45 / PurchasePrice)) + 2
  523.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  524.     'call update procedure
  525.     frmGameScreen.UpdatePlayerStats
  526. Case "Planetary Shield"
  527.     '**unit cost of 15--- finish in 3-5 turns
  528.     'set time to finish research
  529.     Player(Current).ShieldResearchDone = TurnNumber + Int(Rnd * Int(30 / PurchasePrice)) + 3
  530.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  531.     'call update procedure
  532.     frmGameScreen.UpdatePlayerStats
  533. Case "Laser Rifle"
  534.     '**unit cost of 10--- finish in 2-4 turns
  535.     'set time to finish research
  536.     Player(Current).LaserResearchDone = TurnNumber + Int(Rnd * Int(20 / PurchasePrice)) + 2
  537.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  538.     'call update procedure
  539.     frmGameScreen.UpdatePlayerStats
  540. Case "Plasma Rifle"
  541.     '**unit cost of 15--- finish in 2-4 turns
  542.     'set time to finish research
  543.     Player(Current).PlasmaResearchDone = TurnNumber + Int(Rnd * Int(30 / PurchasePrice)) + 2
  544.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  545.     'call update procedure
  546.     frmGameScreen.UpdatePlayerStats
  547. Case "Mechanized Assault Troops"
  548.     '**unit cost=15 --- finish in 2-5 turns
  549.     'set time to finish research
  550.     Player(Current).MechResearchDone = TurnNumber + Int(Rnd * Int(45 / PurchasePrice)) + 2
  551.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  552.     'call update procedure
  553.     frmGameScreen.UpdatePlayerStats
  554. Case "BioHazard Rocket"
  555.     '**unit cost of 25--- finish in 4-6 turns
  556.     'set time to finish research
  557.     Player(Current).BioRocketResearchDone = TurnNumber + Int(Rnd * Int(75 / PurchasePrice)) + 3
  558.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  559.     'call update procedure
  560.     frmGameScreen.UpdatePlayerStats
  561. Case "Long-Range BioHazard Rocket"
  562.     '**unit cost of 25--- finish in 2-4 turns
  563.     'set time to finish research
  564.     Player(Current).LongBioResearchDone = TurnNumber + Int(Rnd * Int(50 / PurchasePrice)) + 2
  565.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  566.     'call update procedure
  567.     frmGameScreen.UpdatePlayerStats
  568. Case "Shields - Level I"
  569.     '**unit cost of 10--- finish in 2-4 turns
  570.     'set time to finish research
  571.     Player(Current).ShipShield1ResearchDone = TurnNumber + Int(Rnd * Int(20 / PurchasePrice)) + 2
  572.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  573.     'call update procedure
  574.     frmGameScreen.UpdatePlayerStats
  575. Case "Shields - Level II"
  576.     '**unit cost of 15--- finish in 2-4 turns
  577.     'set time to finish research
  578.     Player(Current).ShipShield2ResearchDone = TurnNumber + Int(Rnd * Int(30 / PurchasePrice)) + 2
  579.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  580.     'call update procedure
  581.     frmGameScreen.UpdatePlayerStats
  582. Case "Expand Ship Capacity"
  583.     '*unit cost 15 - 2-5 turns
  584.     Player(Current).BigShipResearchDone = TurnNumber + Int(Rnd * Int(60 / PurchasePrice)) + 2
  585.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  586.     'call update procedure
  587.     frmGameScreen.UpdatePlayerStats
  588. Case "UltraWarp Ship Engines"
  589.     '*unit cost 20 - 2-5 turns
  590.     Player(Current).UltraWarpResearchDone = TurnNumber + Int(Rnd * Int(60 / PurchasePrice)) + 2
  591.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  592.     'call update procedure
  593.     frmGameScreen.UpdatePlayerStats
  594. Case "Cloaking Device"
  595.     '*unit cost 20, 3-5 turns
  596.     Player(Current).CloakingResearchDone = TurnNumber + Int(Rnd * Int(60 / PurchasePrice)) + 3
  597.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  598.     'call update procedure
  599.     frmGameScreen.UpdatePlayerStats
  600. Case "Improved Resource Production"
  601.     '**unit cost=20---finish in 3-5 turns
  602.     'set time to finish research
  603.     Player(Current).ResourceResearchDone = TurnNumber + Int(Rnd * Int(60 / PurchasePrice)) + 3
  604.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  605.     'call update procedure
  606.     frmGameScreen.UpdatePlayerStats
  607. Case "BioHazard Detoxification"
  608.     '**unit cost=15---finish in 2-4 turns
  609.     'set time to finish research
  610.     Player(Current).BioCleanupResearchDone = TurnNumber + Int(Rnd * Int(30 / PurchasePrice)) + 2
  611.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  612.     'call update procedure
  613.     frmGameScreen.UpdatePlayerStats
  614. Case "Regenerate Barren Environments"
  615.     '**unit cost=15---finish in 2-4 turns
  616.     'set time to finish research
  617.     Player(Current).RegenerationResearchDone = TurnNumber + Int(Rnd * Int(30 / PurchasePrice)) + 2
  618.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  619.     'call update procedure
  620.     frmGameScreen.UpdatePlayerStats
  621. Case "Short-Range Scanner"
  622.     '**unit cost 10  - finish in 2-4 turns
  623.     'set time to finish research
  624.     Player(Current).ScannerResearchDone = TurnNumber + Int(Rnd * Int(20 / PurchasePrice)) + 2
  625.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  626.     'call update procedure
  627.     frmGameScreen.UpdatePlayerStats
  628. Case "Long-Range Scanner"
  629.     '**unit cost 15  - finish in 2-5 turns
  630.     'set time to finish research
  631.     Player(Current).DeepScannerResearchDone = TurnNumber + Int(Rnd * Int(45 / PurchasePrice)) + 2
  632.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  633.     'call update procedure
  634.     frmGameScreen.UpdatePlayerStats
  635. Case "Scanner Jamming Device"
  636.     '**unit cost 15  - finish in 2-5 turns
  637.     'set time to finish research
  638.     Player(Current).JammerResearchDone = TurnNumber + Int(Rnd * Int(45 / PurchasePrice)) + 2
  639.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  640.     'call update procedure
  641.     frmGameScreen.UpdatePlayerStats
  642. Case "Warp Scanner"
  643.     '**unit cost 15  - finish in 3-5 turns
  644.     'set time to finish research
  645.     Player(Current).WarpScannerResearchDone = TurnNumber + Int(Rnd * Int(30 / PurchasePrice)) + 3
  646.     Player(Current).NumResources = Player(Current).NumResources - PurchasePrice
  647.     'call update procedure
  648.     frmGameScreen.UpdatePlayerStats
  649. End Select
  650. frmGameScreen.ClearFrame
  651. 'unload the form
  652. Unload frmResearch
  653. End Sub
  654. Private Sub Form_Load()
  655. 'See which tab items should be visible and/or disabled
  656. If Player(Current).Missile1Researched Then
  657.     optBase2.Visible = True
  658.     optBase1.Enabled = False
  659. End If
  660. 'see if Planetary Shield
  661. If Player(Current).Missile2Researched Then
  662.     optShield.Visible = True
  663.     optBase2.Enabled = False
  664. End If
  665. 'disable planetary shield if done
  666. If Player(Current).ShieldResearched Then
  667.     optShield.Enabled = False
  668. End If
  669. 'see if plasma rifle
  670. If Player(Current).LaserResearched Then
  671.     optPlasma.Visible = True
  672.     optLasers.Enabled = False
  673. End If
  674. 'see if mech
  675. If Player(Current).PlasmaResearched Then
  676.     optMech.Visible = True
  677.     optPlasma.Enabled = False
  678. End If
  679. 'see if biohazard
  680. If Player(Current).MechResearched Then
  681.     optChemical.Visible = True
  682.     optMech.Enabled = False
  683. End If
  684. 'see if long-range biohazard
  685. If Player(Current).BioRocketResearched Then
  686.     optLongBioRocket.Visible = True
  687.     optChemical.Enabled = False
  688. End If
  689. If Player(Current).LongBioResearched Then
  690.     optLongBioRocket.Enabled = False
  691. End If
  692. 'see if warp shields 2 and bigger ship
  693. If Player(Current).ShipShield1Researched Then
  694.     optShields2.Visible = True
  695.     optBigger.Visible = True
  696.     optShields1.Enabled = False
  697. End If
  698. 'see if ultrawarp choice should be enabled
  699. If Player(Current).BigShipResearched Then
  700.     optUltra.Visible = True
  701.     optShields2.Enabled = False
  702.     optBigger.Enabled = False
  703. End If
  704. 'turn off shield2 if done
  705. If Player(Current).ShipShield2Researched Then
  706.     optShields2.Enabled = False
  707. End If
  708. 'see if cloaking
  709. If Player(Current).UltraWarpResearched Then
  710.     optCloak.Visible = True
  711.     optUltra.Enabled = False
  712. End If
  713. If Player(Current).CloakingResearched Then
  714.     optCloak.Enabled = False
  715. End If
  716. 'see if detox
  717. If Player(Current).BioRocketResearched And Player(Current).ResourcesResearched Then
  718.     optCleanup.Visible = True
  719.     optImprove.Enabled = False
  720. End If
  721. 'see if regeneration
  722. If Player(Current).BioCleanupResearched Then
  723.     optRegenerate.Visible = True
  724.     optCleanup.Enabled = False
  725. End If
  726. If Player(Current).RegenerationResearched Then
  727.     optRegenerate.Enabled = False
  728. End If
  729. 'see if long-range scanner should be on
  730. If Player(Current).ScannerResearched Then
  731.     optLongScan.Visible = True
  732.     optShortScan.Enabled = False
  733. End If
  734. 'see if jammer
  735. If Player(Current).DeepScannerResearched Then
  736.     optJam.Visible = True
  737.     optWarpScan.Visible = True
  738.     optLongScan.Enabled = False
  739. End If
  740. 'disable jammer, warpscan if necessary
  741. If Player(Current).JammerResearched Then
  742.     optJam.Enabled = False
  743. End If
  744. If Player(Current).WarpScannerResearched Then
  745.     optWarpScan.Enabled = False
  746. End If
  747. If Player(Current).RegenerationResearched Then
  748.     optRegenerate.Enabled = False
  749. End If
  750. If Player(Current).ResourcesResearched Then
  751.     optImprove.Enabled = False
  752. End If
  753. End Sub
  754. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  755. cmdCancel_Click
  756. End Sub
  757. Private Sub hsbAmount_Change()
  758. 'use horizontal scroll bar to set amount of resources being allocated
  759. 'also done in Scroll method
  760. lblQuantity.Caption = Str(hsbAmount.Value)
  761. 'calculate total cost:
  762. txtTotal.Text = Str(hsbAmount.Value * UnitCost)
  763. If hsbAmount.Value = 0 Then
  764.     cmdOK.Enabled = False
  765. End If
  766. If hsbAmount.Value > 0 Then
  767.     cmdOK.Enabled = True
  768. End If
  769. End Sub
  770. Private Sub hsbAmount_Scroll()
  771. lblQuantity.Caption = Str(hsbAmount.Value)
  772. txtTotal.Text = Str(hsbAmount.Value * UnitCost)
  773. End Sub
  774. Private Sub optAssault_Click()
  775. 'see if mech research already done
  776. If Player(Current).MechResearched Then
  777.     PlaySoundEffect "Quiet"
  778.     MsgBox "You already have this technology"
  779.     ClearFrame
  780.     Exit Sub
  781. ElseIf Player(Current).MechResearchDone > 0 Then
  782.     'research already underway
  783.     PlaySoundEffect "Quiet"
  784.     MsgBox "This project is already underway"
  785.     ClearFrame
  786.     Exit Sub
  787.     'check if enough money
  788.     UnitCost = 15
  789.     txtUnitCost.Text = Str(UnitCost)
  790.     lblName.Caption = "Assault Troops"
  791.     If Player(Current).NumResources >= UnitCost Then
  792.         'enable the amount frame
  793.         fraAmount.Enabled = True
  794.         hsbAmount.Value = 0
  795.         'set label,text, and unit cost
  796.         lblName.Caption = "Assault Troops"
  797.         txtUnitCost.Text = Str(UnitCost)
  798.         'set max value for scrollbar
  799.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  800.     Else
  801.         'not enough money
  802.         PlaySoundEffect "Quiet"
  803.         MsgBox "Insufficient resources", vbExclamation, "Funding Shortfall"
  804.         ClearFrame
  805.     End If
  806. End If
  807. End Sub
  808. Private Sub optBase1_Click()
  809. 'see if missile base 1 research already done
  810. If Player(Current).Missile1Researched Then
  811.     PlaySoundEffect "Quiet"
  812.     MsgBox "You already have this technology"
  813.     ClearFrame
  814.     Exit Sub
  815. ElseIf Player(Current).Missile1ResearchDone > 0 Then
  816.     'research already underway
  817.     PlaySoundEffect "Quiet"
  818.     MsgBox "This project is already underway"
  819.     ClearFrame
  820.     Exit Sub
  821.     'check if enough money
  822.     UnitCost = 10
  823.     txtUnitCost.Text = Str(UnitCost)
  824.     lblName.Caption = "Missile Base - Level I"
  825.     If Player(Current).NumResources >= UnitCost Then
  826.         'enable the amount frame
  827.         fraAmount.Enabled = True
  828.         hsbAmount.Value = 0
  829.         'set label,text, and unit cost
  830.         'lblName.Caption = "Planetary Defenses"
  831.         txtUnitCost.Text = Str(UnitCost)
  832.         'set max value for scrollbar
  833.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  834.     Else
  835.         'not enough money
  836.         PlaySoundEffect "Quiet"
  837.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  838.         ClearFrame
  839.     End If
  840. End If
  841. End Sub
  842. Private Sub optBase2_Click()
  843. 'see if missile base 2 research already done
  844. If Player(Current).Missile2Researched Then
  845.     PlaySoundEffect "Quiet"
  846.     MsgBox "You already have this technology"
  847.     ClearFrame
  848.     Exit Sub
  849. ElseIf Player(Current).Missile2ResearchDone > 0 Then
  850.     'research already underway
  851.     PlaySoundEffect "Quiet"
  852.     MsgBox "This project is already underway"
  853.     ClearFrame
  854.     Exit Sub
  855.     'check if enough money
  856.     UnitCost = 15
  857.     txtUnitCost.Text = Str(UnitCost)
  858.     lblName.Caption = "Missile Base - Level II"
  859.     If Player(Current).NumResources >= UnitCost Then
  860.         'enable the amount frame
  861.         fraAmount.Enabled = True
  862.         hsbAmount.Value = 0
  863.         'set label,text, and unit cost
  864.         'lblName.Caption = "Planetary Defenses"
  865.         txtUnitCost.Text = Str(UnitCost)
  866.         'set max value for scrollbar
  867.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  868.     Else
  869.         'not enough money
  870.         PlaySoundEffect "Quiet"
  871.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  872.         ClearFrame
  873.     End If
  874. End If
  875. End Sub
  876. Private Sub optBigger_Click()
  877. 'see if bigger ship research already done
  878. If Player(Current).BigShipResearched Then
  879.     PlaySoundEffect "Quiet"
  880.     MsgBox "You already have this technology"
  881.     ClearFrame
  882.     Exit Sub
  883. ElseIf Player(Current).BigShipResearchDone > 0 Then
  884.     'research already underway
  885.     PlaySoundEffect "Quiet"
  886.     MsgBox "This project is already underway"
  887.     ClearFrame
  888.     Exit Sub
  889.     'check if enough money
  890.     UnitCost = 15
  891.     txtUnitCost.Text = Str(UnitCost)
  892.     lblName.Caption = "Expand Ship Capacity"
  893.     If Player(Current).NumResources >= UnitCost Then
  894.         'enable the amount frame
  895.         fraAmount.Enabled = True
  896.         hsbAmount.Value = 0
  897.         'set label,text, and unit cost
  898.         lblName.Caption = "Expand Ship Capacity"
  899.         txtUnitCost.Text = Str(UnitCost)
  900.         'set max value for scrollbar
  901.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  902.     Else
  903.         'not enough money
  904.         PlaySoundEffect "Quiet"
  905.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  906.         ClearFrame
  907.     End If
  908. End If
  909. End Sub
  910. Private Sub optChemical_Click()
  911. 'see if biohazard rocket research already done
  912. If Player(Current).BioRocketResearched Then
  913.     PlaySoundEffect "Quiet"
  914.     MsgBox "You already have this technology"
  915.     ClearFrame
  916.     Exit Sub
  917. ElseIf Player(Current).BioRocketResearchDone > 0 Then
  918.     'research already underway
  919.     PlaySoundEffect "Quiet"
  920.     MsgBox "This project is already underway"
  921.     ClearFrame
  922.     Exit Sub
  923.     'check if enough money
  924.     UnitCost = 25
  925.     txtUnitCost.Text = Str(UnitCost)
  926.     lblName.Caption = "BioHazard Rocket"
  927.     If Player(Current).NumResources >= UnitCost Then
  928.         'enable the amount frame
  929.         fraAmount.Enabled = True
  930.         hsbAmount.Value = 0
  931.         'set label,text, and unit cost
  932.         txtUnitCost.Text = Str(UnitCost)
  933.         'set max value for scrollbar
  934.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  935.     Else
  936.         'not enough money
  937.         PlaySoundEffect "Quiet"
  938.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  939.         ClearFrame
  940.     End If
  941. End If
  942. End Sub
  943. Private Sub optCleanup_Click()
  944. 'see if planet detoxification research already done
  945. If Player(Current).BioCleanupResearched Then
  946.     PlaySoundEffect "Quiet"
  947.     MsgBox "You already have this technology"
  948.     ClearFrame
  949.     Exit Sub
  950. ElseIf Player(Current).BioCleanupResearchDone > 0 Then
  951.     'research already underway
  952.     PlaySoundEffect "Quiet"
  953.     MsgBox "This project is already underway"
  954.     ClearFrame
  955.     Exit Sub
  956.     'check if enough money
  957.     UnitCost = 15
  958.     txtUnitCost.Text = Str(UnitCost)
  959.     lblName.Caption = "BioHazard Detoxification"
  960.     If Player(Current).NumResources >= UnitCost Then
  961.         'enable the amount frame
  962.         fraAmount.Enabled = True
  963.         hsbAmount.Value = 0
  964.         'set label,text, and unit cost
  965.         txtUnitCost.Text = Str(UnitCost)
  966.         'set max value for scrollbar
  967.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  968.     Else
  969.         'not enough money
  970.         PlaySoundEffect "Quiet"
  971.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  972.         ClearFrame
  973.     End If
  974. End If
  975. End Sub
  976. Private Sub optCloak_Click()
  977. 'see if cloaking device research already done
  978. If Player(Current).CloakingResearched Then
  979.     PlaySoundEffect "Quiet"
  980.     MsgBox "You already have this technology"
  981.     ClearFrame
  982.     Exit Sub
  983. ElseIf Player(Current).CloakingResearchDone > 0 Then
  984.     'research already underway
  985.     PlaySoundEffect "Quiet"
  986.     MsgBox "This project is already underway"
  987.     ClearFrame
  988.     Exit Sub
  989.     'check if enough money
  990.     UnitCost = 20
  991.     txtUnitCost.Text = Str(UnitCost)
  992.     lblName.Caption = "Cloaking Device"
  993.     If Player(Current).NumResources >= UnitCost Then
  994.         'enable the amount frame
  995.         fraAmount.Enabled = True
  996.         hsbAmount.Value = 0
  997.         'set label,text, and unit cost
  998.         txtUnitCost.Text = Str(UnitCost)
  999.         'set max value for scrollbar
  1000.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1001.     Else
  1002.         'not enough money
  1003.         PlaySoundEffect "Quiet"
  1004.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1005.         ClearFrame
  1006.     End If
  1007. End If
  1008. End Sub
  1009. Private Sub optDeepScanner_Click()
  1010. 'see if long-range scanner research already done
  1011. If Player(Current).DeepScannerResearched Then
  1012.     PlaySoundEffect "Quiet"
  1013.     MsgBox "You already have this technology"
  1014.     ClearFrame
  1015.     Exit Sub
  1016. ElseIf Player(Current).DeepScannerResearchDone > 0 Then
  1017.     'research already underway
  1018.     PlaySoundEffect "Quiet"
  1019.     MsgBox "This project is already underway"
  1020.     ClearFrame
  1021.     Exit Sub
  1022.     'check if enough money
  1023.     UnitCost = 10
  1024.     txtUnitCost.Text = Str(UnitCost)
  1025.     lblName.Caption = "Deep-Space Scanner"
  1026.     If Player(Current).NumResources >= UnitCost Then
  1027.         'enable the amount frame
  1028.         fraAmount.Enabled = True
  1029.         hsbAmount.Value = 0
  1030.         'set label,text, and unit cost
  1031.         lblName.Caption = "Deep-Space Scanner"
  1032.         txtUnitCost.Text = Str(UnitCost)
  1033.         'set max value for scrollbar
  1034.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1035.     Else
  1036.         'not enough money
  1037.         PlaySoundEffect "Quiet"
  1038.         MsgBox "Insufficient resources", vbExclamation, "Funding Shortfall"
  1039.         ClearFrame
  1040.     End If
  1041. End If
  1042. End Sub
  1043. Private Sub optImprove_Click()
  1044. 'see if improved resource production research already done
  1045. If Player(Current).ResourcesResearched Then
  1046.     PlaySoundEffect "Quiet"
  1047.     MsgBox "You already have this technology"
  1048.     ClearFrame
  1049.     Exit Sub
  1050. ElseIf Player(Current).ResourceResearchDone > 0 Then
  1051.     'research already underway
  1052.     PlaySoundEffect "Quiet"
  1053.     MsgBox "This project is already underway"
  1054.     ClearFrame
  1055.     Exit Sub
  1056.     'check if enough money
  1057.     UnitCost = 20
  1058.     txtUnitCost.Text = Str(UnitCost)
  1059.     lblName.Caption = "Improved Resource Production"
  1060.     If Player(Current).NumResources >= UnitCost Then
  1061.         'enable the amount frame
  1062.         fraAmount.Enabled = True
  1063.         hsbAmount.Value = 0
  1064.         'set label,text, and unit cost
  1065.         txtUnitCost.Text = Str(UnitCost)
  1066.         'set max value for scrollbar
  1067.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1068.     Else
  1069.         'not enough money
  1070.         PlaySoundEffect "Quiet"
  1071.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1072.         ClearFrame
  1073.     End If
  1074. End If
  1075. End Sub
  1076. Private Sub optJam_Click()
  1077. 'see if scanner jamming research already done
  1078. If Player(Current).JammerResearched Then
  1079.     PlaySoundEffect "Quiet"
  1080.     MsgBox "You already have this technology"
  1081.     ClearFrame
  1082.     Exit Sub
  1083. ElseIf Player(Current).JammerResearchDone > 0 Then
  1084.     'research already underway
  1085.     PlaySoundEffect "Quiet"
  1086.     MsgBox "This project is already underway"
  1087.     ClearFrame
  1088.     Exit Sub
  1089.     'check if enough money
  1090.     UnitCost = 15
  1091.     txtUnitCost.Text = Str(UnitCost)
  1092.     lblName.Caption = "Scanner Jamming Device"
  1093.     If Player(Current).NumResources >= UnitCost Then
  1094.         'enable the amount frame
  1095.         fraAmount.Enabled = True
  1096.         hsbAmount.Value = 0
  1097.         'set label,text, and unit cost
  1098.         txtUnitCost.Text = Str(UnitCost)
  1099.         'set max value for scrollbar
  1100.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1101.     Else
  1102.         'not enough money
  1103.         PlaySoundEffect "Quiet"
  1104.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1105.         ClearFrame
  1106.     End If
  1107. End If
  1108. End Sub
  1109. Private Sub optLasers_Click()
  1110. 'see if laser rifle research already done
  1111. If Player(Current).LaserResearched Then
  1112.     PlaySoundEffect "Quiet"
  1113.     MsgBox "You already have this technology"
  1114.     ClearFrame
  1115.     Exit Sub
  1116. ElseIf Player(Current).LaserResearchDone > 0 Then
  1117.     'research already underway
  1118.     PlaySoundEffect "Quiet"
  1119.     MsgBox "This project is already underway"
  1120.     ClearFrame
  1121.     Exit Sub
  1122.     'check if enough money
  1123.     UnitCost = 10
  1124.     txtUnitCost.Text = Str(UnitCost)
  1125.     lblName.Caption = "Laser Rifle"
  1126.     If Player(Current).NumResources >= UnitCost Then
  1127.         'enable the amount frame
  1128.         fraAmount.Enabled = True
  1129.         hsbAmount.Value = 0
  1130.         'set label,text, and unit cost
  1131.         txtUnitCost.Text = Str(UnitCost)
  1132.         'set max value for scrollbar
  1133.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1134.     Else
  1135.         'not enough money
  1136.         PlaySoundEffect "Quiet"
  1137.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1138.         ClearFrame
  1139.     End If
  1140. End If
  1141. End Sub
  1142. Private Sub optLongBioRocket_Click()
  1143. 'see if long-range biorocket research already done
  1144. If Player(Current).LongBioResearched Then
  1145.     PlaySoundEffect "Quiet"
  1146.     MsgBox "You already have this technology"
  1147.     ClearFrame
  1148.     Exit Sub
  1149. ElseIf Player(Current).LongBioResearchDone > 0 Then
  1150.     'research already underway
  1151.     PlaySoundEffect "Quiet"
  1152.     MsgBox "This project is already underway"
  1153.     ClearFrame
  1154.     Exit Sub
  1155.     'check if enough money
  1156.     UnitCost = 25
  1157.     txtUnitCost.Text = Str(UnitCost)
  1158.     lblName.Caption = "Long-Range BioHazard Rocket"
  1159.     If Player(Current).NumResources >= UnitCost Then
  1160.         'enable the amount frame
  1161.         fraAmount.Enabled = True
  1162.         hsbAmount.Value = 0
  1163.         'set label,text, and unit cost
  1164.         txtUnitCost.Text = Str(UnitCost)
  1165.         'set max value for scrollbar
  1166.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1167.     Else
  1168.         'not enough money
  1169.         PlaySoundEffect "Quiet"
  1170.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1171.         ClearFrame
  1172.     End If
  1173. End If
  1174. End Sub
  1175. Private Sub optLongScan_Click()
  1176. 'see if long-range scanner research already done
  1177. If Player(Current).DeepScannerResearched Then
  1178.     PlaySoundEffect "Quiet"
  1179.     MsgBox "You already have this technology"
  1180.     ClearFrame
  1181.     Exit Sub
  1182. ElseIf Player(Current).DeepScannerResearchDone > 0 Then
  1183.     'research already underway
  1184.     PlaySoundEffect "Quiet"
  1185.     MsgBox "This project is already underway"
  1186.     ClearFrame
  1187.     Exit Sub
  1188.     'check if enough money
  1189.     UnitCost = 15
  1190.     txtUnitCost.Text = Str(UnitCost)
  1191.     lblName.Caption = "Long-Range Scanner"
  1192.     If Player(Current).NumResources >= UnitCost Then
  1193.         'enable the amount frame
  1194.         fraAmount.Enabled = True
  1195.         hsbAmount.Value = 0
  1196.         'set label,text, and unit cost
  1197.         txtUnitCost.Text = Str(UnitCost)
  1198.         'set max value for scrollbar
  1199.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1200.     Else
  1201.         'not enough money
  1202.         PlaySoundEffect "Quiet"
  1203.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1204.         ClearFrame
  1205.     End If
  1206. End If
  1207. End Sub
  1208. Private Sub optMech_Click()
  1209. 'see if mech research already done
  1210. If Player(Current).MechResearched Then
  1211.     PlaySoundEffect "Quiet"
  1212.     MsgBox "You already have this technology"
  1213.     ClearFrame
  1214.     Exit Sub
  1215. ElseIf Player(Current).MechResearchDone > 0 Then
  1216.     'research already underway
  1217.     PlaySoundEffect "Quiet"
  1218.     MsgBox "This project is already underway"
  1219.     ClearFrame
  1220.     Exit Sub
  1221.     'check if enough money
  1222.     UnitCost = 15
  1223.     txtUnitCost.Text = Str(UnitCost)
  1224.     lblName.Caption = "Mechanized Assault Troops"
  1225.     If Player(Current).NumResources >= UnitCost Then
  1226.         'enable the amount frame
  1227.         fraAmount.Enabled = True
  1228.         hsbAmount.Value = 0
  1229.         'set label,text, and unit cost
  1230.         txtUnitCost.Text = Str(UnitCost)
  1231.         'set max value for scrollbar
  1232.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1233.     Else
  1234.         'not enough money
  1235.         PlaySoundEffect "Quiet"
  1236.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1237.         ClearFrame
  1238.     End If
  1239. End If
  1240. End Sub
  1241. Private Sub optPlasma_Click()
  1242. 'see if plasma rifle research already done
  1243. If Player(Current).PlasmaResearched Then
  1244.     PlaySoundEffect "Quiet"
  1245.     MsgBox "You already have this technology"
  1246.     ClearFrame
  1247.     Exit Sub
  1248. ElseIf Player(Current).PlasmaResearchDone > 0 Then
  1249.     'research already underway
  1250.     PlaySoundEffect "Quiet"
  1251.     MsgBox "This project is already underway"
  1252.     ClearFrame
  1253.     Exit Sub
  1254.     'check if enough money
  1255.     UnitCost = 10
  1256.     txtUnitCost.Text = Str(UnitCost)
  1257.     lblName.Caption = "Plasma Rifle"
  1258.     If Player(Current).NumResources >= UnitCost Then
  1259.         'enable the amount frame
  1260.         fraAmount.Enabled = True
  1261.         hsbAmount.Value = 0
  1262.         'set label,text, and unit cost
  1263.         txtUnitCost.Text = Str(UnitCost)
  1264.         'set max value for scrollbar
  1265.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1266.     Else
  1267.         'not enough money
  1268.         PlaySoundEffect "Quiet"
  1269.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1270.         ClearFrame
  1271.     End If
  1272. End If
  1273. End Sub
  1274. Private Sub optRegenerate_Click()
  1275. 'see if planet regeneration research already done
  1276. If Player(Current).RegenerationResearched Then
  1277.     PlaySoundEffect "Quiet"
  1278.     MsgBox "You already have this technology"
  1279.     ClearFrame
  1280.     Exit Sub
  1281. ElseIf Player(Current).RegenerationResearchDone > 0 Then
  1282.     'research already underway
  1283.     PlaySoundEffect "Quiet"
  1284.     MsgBox "This project is already underway"
  1285.     ClearFrame
  1286.     Exit Sub
  1287.     'check if enough money
  1288.     UnitCost = 15
  1289.     txtUnitCost.Text = Str(UnitCost)
  1290.     lblName.Caption = "Regenerate Barren Environments"
  1291.     If Player(Current).NumResources >= UnitCost Then
  1292.         'enable the amount frame
  1293.         fraAmount.Enabled = True
  1294.         hsbAmount.Value = 0
  1295.         'set label,text, and unit cost
  1296.         txtUnitCost.Text = Str(UnitCost)
  1297.         'set max value for scrollbar
  1298.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1299.     Else
  1300.         'not enough money
  1301.         PlaySoundEffect "Quiet"
  1302.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1303.         ClearFrame
  1304.     End If
  1305. End If
  1306. End Sub
  1307. Private Sub optShield_Click()
  1308. 'see if planetary shield research already done
  1309. If Player(Current).ShieldResearched Then
  1310.     MsgBox "You already have this technology"
  1311.     ClearFrame
  1312.     Exit Sub
  1313. ElseIf Player(Current).ShieldResearchDone > 0 Then
  1314.     'research already underway
  1315.     MsgBox "This project is already underway"
  1316.     ClearFrame
  1317.     Exit Sub
  1318.     'check if enough money
  1319.     UnitCost = 15
  1320.     txtUnitCost.Text = Str(UnitCost)
  1321.     lblName.Caption = "Planetary Shield"
  1322.     If Player(Current).NumResources >= UnitCost Then
  1323.         'enable the amount frame
  1324.         fraAmount.Enabled = True
  1325.         hsbAmount.Value = 0
  1326.         'set label,text, and unit cost
  1327.         txtUnitCost.Text = Str(UnitCost)
  1328.         'set max value for scrollbar
  1329.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1330.     Else
  1331.         'not enough money
  1332.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1333.         ClearFrame
  1334.     End If
  1335. End If
  1336. End Sub
  1337. Private Sub optShields1_Click()
  1338. 'see if ships shield 1 research already done
  1339. If Player(Current).ShipShield1Researched Then
  1340.     PlaySoundEffect "Quiet"
  1341.     MsgBox "You already have this technology"
  1342.     ClearFrame
  1343.     Exit Sub
  1344. ElseIf Player(Current).ShipShield1ResearchDone > 0 Then
  1345.     'research already underway
  1346.     PlaySoundEffect "Quiet"
  1347.     MsgBox "This project is already underway"
  1348.     ClearFrame
  1349.     Exit Sub
  1350.     'check if enough money
  1351.     UnitCost = 10
  1352.     txtUnitCost.Text = Str(UnitCost)
  1353.     lblName.Caption = "Shields - Level I"
  1354.     If Player(Current).NumResources >= UnitCost Then
  1355.         'enable the amount frame
  1356.         fraAmount.Enabled = True
  1357.         hsbAmount.Value = 0
  1358.         'set label,text, and unit cost
  1359.         txtUnitCost.Text = Str(UnitCost)
  1360.         'set max value for scrollbar
  1361.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1362.     Else
  1363.         'not enough money
  1364.         PlaySoundEffect "Quiet"
  1365.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1366.         ClearFrame
  1367.     End If
  1368. End If
  1369. End Sub
  1370. Private Sub optShields2_Click()
  1371. 'see if ships shield 2 research already done
  1372. If Player(Current).ShipShield2Researched Then
  1373.     PlaySoundEffect "Quiet"
  1374.     MsgBox "You already have this technology"
  1375.     ClearFrame
  1376.     Exit Sub
  1377. ElseIf Player(Current).ShipShield2ResearchDone > 0 Then
  1378.     'research already underway
  1379.     PlaySoundEffect "Quiet"
  1380.     MsgBox "This project is already underway"
  1381.     ClearFrame
  1382.     Exit Sub
  1383.     'check if enough money
  1384.     UnitCost = 15
  1385.     txtUnitCost.Text = Str(UnitCost)
  1386.     lblName.Caption = "Shields - Level II"
  1387.     If Player(Current).NumResources >= UnitCost Then
  1388.         'enable the amount frame
  1389.         fraAmount.Enabled = True
  1390.         hsbAmount.Value = 0
  1391.         'set label,text, and unit cost
  1392.         txtUnitCost.Text = Str(UnitCost)
  1393.         'set max value for scrollbar
  1394.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1395.     Else
  1396.         'not enough money
  1397.         PlaySoundEffect "Quiet"
  1398.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1399.         ClearFrame
  1400.     End If
  1401. End If
  1402. End Sub
  1403. Public Sub ClearFrame()
  1404. 'clear out the text, value caption etc from research frame
  1405. 'whenever user selects another choice, or has insufficient
  1406. 'resources, or project underway
  1407. hsbAmount.Value = 0
  1408. txtUnitCost.Text = ""
  1409. txtTotal.Text = ""
  1410. lblName.Caption = ""
  1411. fraAmount.Enabled = False
  1412. 'reset values of option buttons
  1413. optBase1.Value = False
  1414. optBase2.Value = False
  1415. optShield.Value = False
  1416. optLasers.Value = False
  1417. optPlasma.Value = False
  1418. optMech.Value = False
  1419. optChemical.Value = False
  1420. optLongBioRocket.Value = False
  1421. optShields1.Value = False
  1422. optShields2.Value = False
  1423. optBigger.Value = False
  1424. optUltra.Value = False
  1425. optCloak.Value = False
  1426. optImprove.Value = False
  1427. optCleanup.Value = False
  1428. optRegenerate.Value = False
  1429. optShortScan.Value = False
  1430. optLongScan.Value = False
  1431. optJam.Value = False
  1432. optWarpScan.Value = False
  1433. End Sub
  1434. Private Sub optShortScan_Click()
  1435. 'see if scanner research already done
  1436. If Player(Current).ScannerResearched Then
  1437.     PlaySoundEffect "Quiet"
  1438.     MsgBox "You already have this technology"
  1439.     ClearFrame
  1440.     Exit Sub
  1441. ElseIf Player(Current).ScannerResearchDone > 0 Then
  1442.     'research already underway
  1443.     PlaySoundEffect "Quiet"
  1444.     MsgBox "This project is already underway"
  1445.     ClearFrame
  1446.     Exit Sub
  1447.     'check if enough money
  1448.     UnitCost = 10
  1449.     txtUnitCost.Text = Str(UnitCost)
  1450.     lblName.Caption = "Short-Range Scanner"
  1451.     If Player(Current).NumResources >= UnitCost Then
  1452.         'enable the amount frame
  1453.         fraAmount.Enabled = True
  1454.         hsbAmount.Value = 0
  1455.         'set label,text, and unit cost
  1456.         txtUnitCost.Text = Str(UnitCost)
  1457.         'set max value for scrollbar
  1458.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1459.     Else
  1460.         'not enough money
  1461.         PlaySoundEffect "Quiet"
  1462.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1463.         ClearFrame
  1464.     End If
  1465. End If
  1466. End Sub
  1467. Private Sub optUltra_Click()
  1468. 'see if ultrawarp engine research already done
  1469. If Player(Current).UltraWarpResearched Then
  1470.     PlaySoundEffect "Quiet"
  1471.     MsgBox "You already have this technology"
  1472.     ClearFrame
  1473.     Exit Sub
  1474. ElseIf Player(Current).UltraWarpResearchDone > 0 Then
  1475.     'research already underway
  1476.     PlaySoundEffect "Quiet"
  1477.     MsgBox "This project is already underway"
  1478.     ClearFrame
  1479.     Exit Sub
  1480.     'check if enough money
  1481.     UnitCost = 20
  1482.     txtUnitCost.Text = Str(UnitCost)
  1483.     lblName.Caption = "UltraWarp Ship Engines"
  1484.     If Player(Current).NumResources >= UnitCost Then
  1485.         'enable the amount frame
  1486.         fraAmount.Enabled = True
  1487.         hsbAmount.Value = 0
  1488.         'set label,text, and unit cost
  1489.         txtUnitCost.Text = Str(UnitCost)
  1490.         'set max value for scrollbar
  1491.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1492.     Else
  1493.         'not enough money
  1494.         PlaySoundEffect "Quiet"
  1495.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1496.         ClearFrame
  1497.     End If
  1498. End If
  1499. End Sub
  1500. Private Sub optWarpScan_Click()
  1501. 'see if warp path scanner research already done
  1502. If Player(Current).WarpScannerResearched Then
  1503.     PlaySoundEffect "Quiet"
  1504.     MsgBox "You already have this technology"
  1505.     ClearFrame
  1506.     Exit Sub
  1507. ElseIf Player(Current).WarpScannerResearchDone > 0 Then
  1508.     'research already underway
  1509.     PlaySoundEffect "Quiet"
  1510.     MsgBox "This project is already underway"
  1511.     ClearFrame
  1512.     Exit Sub
  1513.     'check if enough money
  1514.     UnitCost = 15
  1515.     txtUnitCost.Text = Str(UnitCost)
  1516.     lblName.Caption = "Warp Scanner"
  1517.     If Player(Current).NumResources >= UnitCost Then
  1518.         'enable the amount frame
  1519.         fraAmount.Enabled = True
  1520.         hsbAmount.Value = 0
  1521.         'set label,text, and unit cost
  1522.         txtUnitCost.Text = Str(UnitCost)
  1523.         'set max value for scrollbar
  1524.         hsbAmount.Max = Int(Player(Current).NumResources / UnitCost)
  1525.     Else
  1526.         'not enough money
  1527.         PlaySoundEffect "Quiet"
  1528.         MsgBox "Insufficient resources", vbExclamation, "Project Cancelled"
  1529.         ClearFrame
  1530.     End If
  1531. End If
  1532. End Sub
  1533. Private Sub tabResearch_Click(PreviousTab As Integer)
  1534. 'reset research variables
  1535. ClearFrame
  1536. End Sub
  1537.